#include <iostream>
#include "MyString.h"
#include "string.h"
using namespace std;

int main01(int argc, char const *argv[])
{
        MyString s1;
        MyString s2("s2");
        //MyString s2_2 = NULL;
        MyString s3 = s2;
        MyString s4 = "s444444444";
        
        s4 = s2;
        s4 = "s4444";
        s4[1] = '1';
        printf("%c\n", s4[1]);
        cout<<s4<<endl;
        return 0;
}

int main02(int argc, char const *argv[])
{
        MyString s2("s2");
        MyString s3 = s2;

        if(s2 == "s2222")
        {
                printf("相等\n");
        }else{
                printf("不相等\n");
        }

        if(s3 == s2)
        {
                printf("相等\n");
        }else{
                printf("不相等\n");
        }

        if(s2 != "s22222222")
        {
                printf("不相等\n");
        }else{
                printf("相等\n");
        }

        if(s3 != s2)
        {
                printf("不相等\n");
        }else{
                printf("相等\n");
        }
        return 0;
}

int main03(int argc, char const *argv[])
{
        MyString s2("s2");
        MyString s3 = s2;

        s3 = "aaa";

        if(s3 < "bbb"){
                printf(" s3 小于 bbb \n");
        }else{
                printf(" s3 大于 bbb \n");
        }

        if(s3 < s2){
                printf(" s3 小于 s2 \n");
        }else{
                printf(" s3 大于s2 \n");
        }

        MyString s4 = "aaaaffff";
        strcpy(s4.c_str(), "aa11");
        cout<<s4<<endl;
        return 0;
}

int main(int argc, char const *argv[])
{
        MyString s1;

        cout<<"\n请输入字符串(回车结束):";
        cin>>s1;
        
        cout<<s1<<endl;

        return 0;
}
